using System;
using System.Runtime.Serialization;

namespace  BEGDC.Utility.ExceptionManagement
{
	/// <summary>
	/// Summary description for GDCException.
	/// </summary>
	[Serializable]
	public class GDCException : Exception
	{
		/// <summary>
		/// Default constructor
		/// </summary>
		/// <param name="errorNumber">Error number</param>
		/// <param name="culture">culture string ,it's case sensitive</param>
		public GDCException(string errorNumber) : base()
		{
			this.m_ErrorNumber = errorNumber;
		}

		/// <summary>
		/// Constructor with exception message
		/// </summary>
		/// <param name="errorNumber">Error number</param>
		/// <param name="message">Your exception message</param>
		/// <param name="culture">Culture string ,it's case sensitive</param>
		public GDCException(string errorNumber,string message) : base(message)
		{
			this.m_ErrorNumber = errorNumber;
		}

		// Constructor with message and inner exception
		public GDCException(string errorNumber,string message, Exception inner) : base(message,inner)
		{
			this.m_ErrorNumber = errorNumber;
		}

		private string m_ErrorNumber;
		private string m_ErrorInfomation;
		
		/// <summary>
		/// friendly error information
		/// </summary>
		public string FriendlyInfomation
		{
			get
			{				
//				ResourceHelper.Init(ResourceHelper.Culture);
//				m_ErrorInfomation = ResourceHelper.GetString(this.ErrorNumber,"language/Exception/");
//				if (m_ErrorInfomation==null||m_ErrorInfomation==string.Empty)
//				{
//					return this.Message;
//				}
				return this.m_ErrorInfomation;
			}
			set
			{
				this.m_ErrorInfomation = value;
			}
		}

		public string ErrorNumber
		{
			get
			{
				return m_ErrorNumber;
			}
		}		
	}
}
